package chapter6;

/**
 * Created by lenovo on 2016/3/24.
 */
public class RPG2 {
    public static void main(String[] args){

        SwordsMan2 swordsMan=new SwordsMan2();
        swordsMan.setName("Justin");
        swordsMan.setLevel(1);
        swordsMan.setBlood(200);

        Magician2 magician=new Magician2();
        magician.setName("Monica");
        magician.setLevel(1);
        magician.setBlood(100);

        showBlood(swordsMan);
        showBlood(magician);
    }


    static void showBlood(Role role){

        System.out.printf("%s 血量   %d%n",role.getName(),role.getBlood());

    }
}
